const params = formatSingleParams();

'use api/core/runtime/database/sql/tables.js';
'use api/lib/camelAndUnderscore.js';

function main() {
	let db_name = payload.get().query.db_name;
	if (db_name) {
		DB_NAME = db_name;
	}
	// 验证用户权限
	'use api/user/acl/excerpt.js'

	let tables = getTablesInfo();
	let result = [];
	tables.result.forEach((t) => {
		const newObj = Object.keys(t).reduce((acc, key) => {
			acc[underscoreToCamel(key.toLowerCase())] = t[key];
			return acc;
		}, {});
		result.push(newObj);
	});

	return okMsg({ data: result, count: tables.count });
}
